<form class="form-horizontal" id="form-add-swiper">

    <div class="form-group">
        <label class="control-label col-xs-2">
            品牌名称
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="text" class="form-control" maxlength="20" name="title" value="{$info.title}" placeholder="请输入品牌名称" required />
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            品牌类型
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <select id="brand-select" name="brand_type" class="form-control" tabindex="-1">
                <option value="1" {if $info.brand_type eq 1}selected{/if}>普通区</option>
                <option value="2" {if $info.brand_type eq 2}selected{/if}>品牌区</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">品牌图标<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            {include file="public/singleImageUploader" uploader-name="img_url" /}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">关联分类</label>
        <div class="col-xs-9">
            {volist name="category_list" id="item"}
            <label class="checkbox-inline"><input type="checkbox" name="category_id1[]" value="{$item.id}" {if condition="$item.cbid > 0"}checked{/if} >{$item.title|get_visible_title=$item.is_visible}【ID：{$item.id}】</label>
            {/volist}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">备注描述</label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="description" placeholder="备注描述" value="{$info.description}" />
        </div>
    </div>



    <div class="form-group">
        <label class="control-label col-xs-2">排序</label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="display_order" placeholder="序号越高，显示越靠前" value="{$info.display_order}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">是否显示</label>
        <div class="col-xs-9">
            <div class="btn-group" data-toggle="buttons">
                <label class="btn btn-default {if condition='$info.is_visible'}active{/if}">
                    <input type="radio" name="visible" id="visible_1" value="1" {if condition="$info.is_visible"}checked{/if}> 显示
                </label>
                <label class="btn btn-default {if condition='!$info.is_visible'}active{/if}">
                    <input type="radio" name="visible" id="visible_0" value="0" {if condition="!$info.is_visible"}checked{/if}> 隐藏
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-xs-offset-2 col-xs-3">
            <button type="submit" class="btn btn-success btn-block">确认添加</button>
        </div>
    </div>
</form>

<script src="__PUBLIC__/vendors/jquery.validation/jquery.validate.min.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/additional-methods.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/messages_zh.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#form-add-swiper").validate({
            messages:
                {
                    title:'请输入品牌名称'
                },
            debug: true,
            submitHandler: function () {
                ajaxSubmit('form-add-swiper', true);
            }
        });

    })
</script>